#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7, M = 2 * N;
int n, m;
int e[M], ne[M], h[N], idx;
int color[N];
inline void add(int a, int b) { e[idx] = b, ne[idx] = h[a], h[a] = idx++; }
bool dfs(int u, int c) {
  color[u] = c;
  for (int i = h[u]; i != -1; i = ne[i]) {
    int j = e[i];
    if (!color[j]) {
      if (!dfs(j, 3 - c)) return false;
    } else if (color[j] == c)
      return false;
  }
  return true;
}
int main() {
  cin >> n >> m;
  memset(h, -1, sizeof h);
  while (m--) {
    int u, v;
    cin >> u >> v;
    add(u, v), add(v, u);
  }
  for (int i = 1; i <= n; ++i) {
    if (color[i]) continue;

    if (!dfs(i, 1)) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  return 0;
}
